const path = require('path')

const config = () => {
    return {
        version: '1.0.0',
        port:9000,
        redisOn:true, //是否启用redis
        redisString:"redis://default:@127.0.0.1:6379/7",
        prefixString:"api", //如果不需要前缀 则为空
        secret:"nmWeqB7G84SkIfZ3",
        loginMaxAge:60 * 60 * 8,
        domain:"http://localhost:5173/",
        whiteList:[ //跨域域名白名单
          "http://localhost:5173",
          "http://127.0.0.1:5173"
        ],
        remit:[ //不包含统一前缀
            "/captcha",
            "/user/login"
        ],
        mysql:{
            host:"127.0.0.1",
            port:"3316",
            username:"root",
            password:"123456",
            database:"wos"
        },
        query:{
            pageNumLable:"pageNum", //分页默认名称
            pageSizeLable:"pageSize", //分页默认名称
        },
        upload:{
            uploadDir:path.resolve(__dirname, './files/upload'), //相对于src目录
            uriPrefix:'http://localhost:5173/upload/', //互联网地址
            keepExtensions:true, //是否保持后缀名
            maxFileSize:1024 * 1024 * 500, //bytes
            allowFileType:['image/png', 'image/jpeg'] //允许文件上传的类型
        }
    }
}
module.exports = config()